home *** CD-ROM | disk | FTP | other *** search
- NAME
- srec - convert Motorola DSP load file records to
- S-record format
-
- SYNOPSIS
- srec [-blmrsw] <input file ... >
-
- DESCRIPTION
- Srec takes as input a Motorola DSP absolute load file and
- produces byte-wide Motorola S-record files suitable for
- PROM burning. The Motorola DSP START and END records are
- mapped into S0 and S7/S9 records respectively. All other
- DSP record types are mapped into S1 or S3-type records
- depending on the source processor. SYMBOL and COMMENT records
- are currently ignored.
-
- Since Motorola DSPs use different word sizes, the words
- must be split into bytes and stored in an appropriate format.
- The program examines the machine type field in the load
- file start record to determine the appropriate S-record
- format to use. For example, if the machine ID in the START
- record is DSP56000 or DSP56016, srec generates S1/S9 output
- records; if the machine ID is DSP96000, the program generates
- S3/S7 records.
-
- In the default mode of operation the program writes the
- low, middle, and high bytes of each word
- consecutively to the current S1/S3 record being written. For
- example, given the DSP56000 DATA record below:
-
- address field
- |
- _DATA P 0000
- 0008F8 300000 340000 094E3E
- | | | |
- | | | fourth word
- | | third word
- | second word
- first word
-
- srec would create the following S1 record:
-
- byte count field
- | address field checksum field
- | | |
- S10D0000F808000000300000343E4E09F9
- | | | |
- | | | fourth word
- | | third word
- | second word
- first word
-
- Output records are written to a file named according to
- the following convention:
-
- <basename>.M
-
- where <basename> is the filename of the input load file
- without extension and M is the memory space specifier
- (X, Y, L, or P) for this set of data words. Note that a
- separate file is created for each memory space encountered
- in the input file; thus the maximum number of output files
- in the default mode is 4.
-
- When the -m option is specified, srec splits each DSP source
- word into bytes and stores the bytes in parallel S1/S3
- records. For example, the following DSP56000 DATA record:
-
- address field
- |
- _DATA P 0000
- 0008F8 300000 340000 094E3E
- | | | |
- | | | fourth word
- | | third word
- | second word
- first word
-
- would be converted by srec into the three S1 records below:
-
- byte count field
- | address field
- | |
- S1070000F800003EC2 -- low byte
- S10700000800004EA2 -- mid byte
- S1070000003034098B -- high byte
- | | | | |
- | | | | checksum field
- | | | fourth word
- | | third word
- | second word
- first word
-
- The three records corresponding to the high, middle, and
- low bytes of each data word are written to separate files.
- The files are named according to the following convention:
-
- <basename>.<M><#>
-
- where <basename> is the filename of the input load file
- without extension, <M> is the memory space specifier
- (X, Y, L, or P) for this set of data words, and # is
- one of the digits 0, 1, or 2 corresponding to low, middle,
- and high bytes, respectively.
-
- Note that a separate set of byte-wide files is created for
- each memory space encountered in the input file. Thus the
- number of output files generated is (number of memory spaces
- in input * size of DSP word).
-
- The -s option writes all information to a single file,
- storing the memory space information in the address field
- of the S0 header record. The values stored in the address
- field and their correspondence to the DSP56000 memory
- spaces are as follows:
-
- Value DSP56000 Memory Space
- ----- ---------------------
- 1 X
- 2 Y
- 3 L
- 4 P
-
- When the memory space changes in the DATA or BLOCKDATA
- record, a new S0 header record is generated. The resulting
- output file is named <basename>.s, where <basename> is
- the filename of the input load file without extension.
- The -m and -s options are mutually exclusive.
-
- The -r option causes srec to write bytes high to low rather
- than low to high in the default and -s modes. It has no
- affect when the -m option is given.
-
- Address fields in DSP load records are copied as is to
- the appropriate S1 or S3 record. Subsequent S1 or S3
- record addresses are byte incremented until a new DATA
- record is encountered or end-of-file is reached. In some
- cases the starting S1/S3 record address must be adjusted for
- byte addressing by multiplying the load record start address
- by the number of bytes in a DSP56000 word. When the -b
- option is given, any DATA record address fields are adjusted
- to begin on a byte-multiple address. If the -w option is
- specified (the default) byte-incrementing is not done
- when generating S-record addresses, e.g. the S-record
- addresses are word-oriented rather than byte-oriented.
- The -b and -w options have no effect when used in conjunction
- with the -m mode, since in that case byte and word address
- mappings are 1:1.
-
- DATA records for L space memory contain words which are loaded
- into adjacent X and Y memory locations. In these cases
- performing the default strict word addressing may be
- inappropriate. The -l option can be given to indicate
- that double-word addressing should be used to generate
- subsequent S1/S3 addresses after the initial load address.
- In addition the -l option should be used when doing byte
- addressing since the initial load addresses must be adjusted
- to account for double-word addressing in the load file.
- In general, it is a good idea to use the -l option whenever
- the source load file contains DATA records which refer to
- L memory space.
-
- In the START record only the module id is passed as header
- data for the S0 record; the version number, revision number,
- and comment are ignored. As noted earlier, the machine ID
- field is used to determine what type of S-records to generate
- based on the addressing range of the DSP processor.
-
- OPTIONS
- -b - use byte addressing when transferring load addresses
- to S-record addresses. This means that load file
- DATA record start addresses are multiplied by
- the DSP bytes/word and subsequent S1/S3 record
- addresses are computed based on the data byte count.
- -l - use double-word addressing when transferring load
- addresses from L space to S-record addresses. This
- means that load file DATA records for L space data
- are moved unchanged and subsequent S1/S3 record
- addresses are computed based on the data word count
- divided by 2. This option should always be used
- when the source load file contains DATA records in L
- memory space.
- -m - split each DSP word into bytes and store
- the bytes in parallel S-records. Replaces
- the -3 option. The -m and -s options are
- mutually exclusive.
- -r - write bytes high to low, rather than low to
- high. Has no effect when used with -m option.
- -s - write data to a single file, putting memory
- space information into the address field of the
- S0 header record. Replaces the -1 option.
- Bytes may be reversed with the -r option.
- The -m and -s options are mutually exclusive.
- -w - use word addressing when transferring load addresses
- to S-record addresses. This means that load file
- DATA record start addresses are moved unchanged and
- subsequent S1/S3 record addresses are computed
- based on the data word count.
-
- DIAGNOSTICS
- The program does some checking for invalid input record
- formats, memory spaces, and hex values. It obviously
- cannot check for bad data values if the load file has
- been tampered with. Both START and END records must be
- found in the input file.